//package com.bookcity.front.webfront.security;
//
//import org.springframework.security.authentication.AbstractAuthenticationToken;
//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.util.Assert;
//
//import java.util.Collection;
//
///**
// * @author oldliu
// * @since 1.0
// */
//public class DouyinToken extends AbstractAuthenticationToken {
//    private Object principal;
//    private Object credentials;
//
//    //    public DouyinToken(Collection<? extends GrantedAuthority> authorities) {
////        super(authorities);
////    }
//
//    public DouyinToken(Object principal, Object credentials) {
//        super(null);
//        this.principal = principal;
//        this.credentials = credentials;
//        setAuthenticated(false);
//    }
//    public DouyinToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
//        super(authorities);
//        this.principal = principal;
//        this.credentials = credentials;
//        super.setAuthenticated(true);
//    }
//
//
//    @Override
//    public Object getCredentials() {
//        return credentials;
//    }
//
//    @Override
//    public Object getPrincipal() {
//        return this.principal;
//    }
//
//    @Override
//    public void setAuthenticated(boolean authenticated) {
//        //super.setAuthenticated(authenticated);
//        Assert.isTrue(!authenticated, "Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead");
//        super.setAuthenticated(false);
//    }
//
//    @Override
//    public void eraseCredentials() {
//        super.eraseCredentials();
//    }
//}
